Skip to main content

DNV defect classification model pipeline

  1. Get CCTV videos from DNV

  2. Extract frame every second from each video

  3. Use Azure OCR to extract text from images and create blurred images

  4. Check for abnormal defect code values

  5. Check for abnormal distance values

  6. Create a list of distances where defect codes are found

    a. Method A: grab text from the counter distance column and match defect codes to the counter distance, or

    b. Method B: grab the distance and defect from the access database. Create two lists, one for point defects and another for continuous defects

  7. Remove non-related defect/feature codes such as MWL or MGO from the list created in step 6

  8. Assign distance to all images using interpolation

  9. Assign defect code to images

    a. Assign defect code to all images that have the same distance as the list created in step 6, or

    b. Assign defect code to images that have a high spatial correlation with true defect frame (>= 0.98)

    i. the first image with a defect code at each distance would be selected as the true image with the defect.

    ii. if the defects were only presented in the access database and not the video, additional distances would be created for those defects, and the true image with the defect would be selected by grabbing the middle images from images that had the same distance as the additional distances found in the access database.
  10. Drop images without defect labels that located with 1 m from the defect distance

  11. Assign unlabeled images as ND

  12. Save the output as csv. This file will be used to train the sewer defect classification model

  13. Import images to compute Canada

  14. Create a training and prediction script

    a. Create a dataloader from the dataframe (read the dataframe from step 12)

    b. Either split the data into train and validation beforehand or use the default splitting function from Fastai

    c. Create wandb for each runs

    d. Create the model and train the model

    e. Use f1 and f2 scores as the evaluation metrics

    f. Run the model on test dataset to get F1 and F2 test scores

    g. Log the scores to wandb

    h. Use remove_cb(WandbCallback) before exporting the model

  15. Create a shell script to run the training and prediction scripts

  16. Check the outputs in wandb